
<form class="form-horizontal" name="editUser" ng-submit="save(false)">
	<div class="panel panel-default">
		<div class="panel-heading">
			<span ng-if="newUser">Création d'un utilisation</span>
			<span ng-if="!newUser">Edition de : {{user.firstname}} {{user.lastname}}</span>
		</div>
		<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.firstname"></label>
				<div class="col-sm-10">
					<input type="text" class="form-control" ng-model="user.firstname" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.lastname"></label>
				<div class="col-sm-10">
					<input type="text" class="form-control" ng-model="user.lastname" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.gender"></label>
				<div class="col-sm-10">
					<select class="form-control"
							required
							ng-model="user.gender">
						<option value="UNKNOWN" translate="user.genderEnum.unknown"></option>
						<option value="MALE" translate="user.genderEnum.male"></option>
						<option value="FEMALE" translate="user.genderEnum.female"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.birthdate"></label>
				<div class="col-sm-10">
					<input class="form-control" type="date" ng-model="user.birthdate" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.email"></label>
				<div class="col-sm-10">
					<input type="email" class="form-control" ng-model="user.email" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.newpassword"></label>
				<div class="col-sm-10">
					<input type="password" class="form-control" ng-model="user.passwordNew">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.phone"></label>
				<div class="col-sm-10">
					<input type="text" class="form-control" ng-model="user.phone">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.address"></label>
				<div class="col-sm-10">
					<textarea class="form-control" ng-model="user.address"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.membership"></label>
				<div class="col-sm-10">
					<select class="form-control" 
							required
							ng-model="user.membershipType"
							ng-options="mt.name for mt in membershipTypeList track by mt.id"></select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.rfid"></label>
				<div class="col-sm-10">
					<input type="text" class="form-control" ng-model="user.rfid">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.groups"></label>
				<div class="col-sm-10"
					 fab-user-groups groups="groups" ng-model="user.groups">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" translate="user.comment"></label>
				<div class="col-sm-10">
					<textarea rows="5" class="form-control" ng-model="user.comment"></textarea>
				</div>
			</div>
		</div>
		<div class="panel-footer right">
			<btn-cancel link="#/users"></btn-cancel>
			<btn-submit form="editUser"></btn-submit>
		</div>
	</div>
</form>